package pers.cz.agent;

import pers.cz.transform.LogForwardTransformer;

import java.lang.instrument.Instrumentation;

/**
 * @program: JefLogTail
 * @description: 探针类
 * @author: Cheng Zhi
 * @create: 2023-03-13 20:12
 **/
public class LogTailAgent {

    public static void premain(String agentArgs, Instrumentation inst) {
        System.out.println("=========================================================");
        System.out.println("  _      ____   _____ _______       _____ _      \n" +
                " | |    / __ \\ / ____|__   __|/\\   |_   _| |     \n" +
                " | |   | |  | | |  __   | |  /  \\    | | | |     \n" +
                " | |   | |  | | | |_ |  | | / /\\ \\   | | | |     \n" +
                " | |___| |__| | |__| |  | |/ ____ \\ _| |_| |____ \n" +
                " |______\\____/ \\_____|  |_/_/    \\_\\_____|______|");
        System.out.println("=========================================================");

        // 添加Transformer
        inst.addTransformer(new LogForwardTransformer());                    // 录制接口出入参
    }
}
